<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>numpy.distutils.exec_command &mdash; NumPy v1.18 Manual</title>
    
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.18.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>
    <script type="text/javascript" src="../../_static/js/copybutton.js"></script>
    <link rel="author" title="About these documents" href="../../about.html" >
    <link rel="index" title="Index" href="../../genindex.html" >
    <link rel="search" title="Search" href="../../search.html" >
    <link rel="top" title="NumPy v1.18 Manual" href="../../index.html" >
    <link rel="up" title="Packaging (numpy.distutils)" href="../distutils.html" >
    <link rel="next" title="numpy.distutils.log.set_verbosity" href="numpy.distutils.log.set_verbosity.html" >
    <link rel="prev" title="numpy.distutils.core.Extension" href="numpy.distutils.core.Extension.html" > 
  </head>
  <body>
<div class="container">
  <div class="top-scipy-org-logo-header" style="background-color: #a2bae8;">
    <a href="../../index.html">
      <img border=0 alt="NumPy" src="../../_static/numpy_logo.png"></a>
    </div>
  </div>
</div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
        <li class="active"><a href="https://numpy.org/">NumPy.org</a></li>
        <li class="active"><a href="https://numpy.org/doc">Docs</a></li>
        
        <li class="active"><a href="../../index.html">NumPy v1.18 Manual</a></li>
        

          <li class="active"><a href="../index.html" >NumPy Reference</a></li>
          <li class="active"><a href="../distutils.html" accesskey="U">Packaging (<code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.distutils</span></code>)</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="numpy.distutils.log.set_verbosity.html" title="numpy.distutils.log.set_verbosity"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="numpy.distutils.core.Extension.html" title="numpy.distutils.core.Extension"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="numpy.distutils.core.Extension.html"
                        title="previous chapter">numpy.distutils.core.Extension</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="numpy.distutils.log.set_verbosity.html"
                        title="next chapter">numpy.distutils.log.set_verbosity</a></p>
<div id="searchbox" style="display: none" role="search">
  <h4>Quick search</h4>
    <div>
    <form class="search" action="../../search.html" method="get">
      <input type="text" style="width: inherit;" name="q" />
      <input type="submit" value="search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="module-numpy.distutils.exec_command">
<span id="numpy-distutils-exec-command"></span><h1>numpy.distutils.exec_command<a class="headerlink" href="#module-numpy.distutils.exec_command" title="Permalink to this headline">¶</a></h1>
<p>exec_command</p>
<p>Implements exec_command function that is (almost) equivalent to
commands.getstatusoutput function but on NT, DOS systems the
returned status is actually correct (though, the returned status
values may be different by a factor). In addition, exec_command
takes keyword arguments for (re-)defining environment variables.</p>
<p>Provides functions:</p>
<blockquote>
<div><dl class="simple">
<dt>exec_command  — execute command in a specified directory and</dt><dd><p>in the modified environment.</p>
</dd>
<dt>find_executable — locate a command using info from environment</dt><dd><p>variable PATH. Equivalent to posix <em class="xref py py-obj">which</em>
command.</p>
</dd>
</dl>
</div></blockquote>
<p>Author: Pearu Peterson &lt;<a class="reference external" href="mailto:pearu&#37;&#52;&#48;cens&#46;ioc&#46;ee">pearu<span>&#64;</span>cens<span>&#46;</span>ioc<span>&#46;</span>ee</a>&gt;
Created: 11 January 2003</p>
<p>Requires: Python 2.x</p>
<p>Successfully tested on:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 12%" />
<col style="width: 17%" />
<col style="width: 71%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>os.name</p></th>
<th class="head"><p>sys.platform</p></th>
<th class="head"><p>comments</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>posix</p></td>
<td><p>linux2</p></td>
<td><p>Debian (sid) Linux, Python 2.1.3+, 2.2.3+, 2.3.3
PyCrust 0.9.3, Idle 1.0.2</p></td>
</tr>
<tr class="row-odd"><td><p>posix</p></td>
<td><p>linux2</p></td>
<td><p>Red Hat 9 Linux, Python 2.1.3, 2.2.2, 2.3.2</p></td>
</tr>
<tr class="row-even"><td><p>posix</p></td>
<td><p>sunos5</p></td>
<td><p>SunOS 5.9, Python 2.2, 2.3.2</p></td>
</tr>
<tr class="row-odd"><td><p>posix</p></td>
<td><p>darwin</p></td>
<td><p>Darwin 7.2.0, Python 2.3</p></td>
</tr>
<tr class="row-even"><td><p>nt</p></td>
<td><p>win32</p></td>
<td><p>Windows Me
Python 2.3(EE), Idle 1.0, PyCrust 0.7.2
Python 2.1.1 Idle 0.8</p></td>
</tr>
<tr class="row-odd"><td><p>nt</p></td>
<td><p>win32</p></td>
<td><p>Windows 98, Python 2.1.1. Idle 0.8</p></td>
</tr>
<tr class="row-even"><td><p>nt</p></td>
<td><p>win32</p></td>
<td><p>Cygwin 98-4.10, Python 2.1.1(MSC) - echo tests
fail i.e. redefining environment variables may
not work. FIXED: don’t use cygwin echo!
Comment: also <em class="xref py py-obj">cmd /c echo</em> will not work
but redefining environment variables do work.</p></td>
</tr>
<tr class="row-odd"><td><p>posix</p></td>
<td><p>cygwin</p></td>
<td><p>Cygwin 98-4.10, Python 2.3.3(cygming special)</p></td>
</tr>
<tr class="row-even"><td><p>nt</p></td>
<td><p>win32</p></td>
<td><p>Windows XP, Python 2.3.3</p></td>
</tr>
</tbody>
</table>
<p>Known bugs:</p>
<ul class="simple">
<li><p>Tests, that send messages to stderr, fail when executed from MSYS prompt
because the messages are lost at some point.</p></li>
</ul>
<p class="rubric">Functions</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">exec_command</span></code>(command[, execute_in, …])</p></td>
<td><p>Return (status,output) of executed command.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">filepath_from_subprocess_output</span></code>(output)</p></td>
<td><p>Convert <em class="xref py py-obj">bytes</em> in the encoding used by a subprocess into a filesystem-appropriate <em class="xref py py-obj">str</em>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">find_executable</span></code>(exe[, path, _cache])</p></td>
<td><p>Return full path of a executable or None.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">forward_bytes_to_stdout</span></code>(val)</p></td>
<td><p>Forward bytes from a subprocess call to the console, without attempting to decode them.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_pythonexe</span></code>()</p></td>
<td><p></p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">temp_file_name</span></code>()</p></td>
<td><p></p></td>
</tr>
</tbody>
</table>
</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2019, The SciPy community.
      </li>
      <li>
      Last updated on Feb 20, 2020.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.4.2.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>